<?php
namespace app\interactive\validate;

use think\Validate;

class Question extends Validate{
    //定义验证规则
    protected $rule = [
        'topic|题目' => 'require',
        'optionA|选项A'    => 'require',
        'optionB|选项B'  => 'require',
        'optionC|选项C'  => 'require',
        'optionD|选项D'  => 'require',
        'correct|答案'  => 'require',
        'activeId|题目所属'  => 'require',
    ];

    //定义验证提示
    protected $message = [
        'topic.require' => '请输入题目内容',
        'optionA.require'    => '请输入选项内容',
        'optionB.require'    => '请输入选项内容',
        'optionC.require'    => '请输入选项内容',
        'optionD.require'    => '请输入选项内容',
        'correct.require'    => '请输入正确答案的选项',
        'activeId.require'    => '请选择所属活动',
    ];
}